package com.linxianqin.springbootVue.domain.convert;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.linxianqin.springbootVue.domain.dto.SysLogininforDTO;
import com.linxianqin.springbootVue.domain.entity.SysLogininfor;
import com.linxianqin.springbootVue.domain.vo.SysLogininforExcel;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * 功能描述：SysLogininfor转化接口
 * @author lxq
 * @version 1.00
 * @Date 2020/12/13
 */
@Mapper
public interface SysLogininforConvert {
    SysLogininforConvert INSTANCE = Mappers.getMapper(SysLogininforConvert.class);

    @Mapping(target = "params" ,ignore = true)
    SysLogininforDTO entity2dto(SysLogininfor sysUser);

    List<SysLogininforDTO> entity2dto(List<SysLogininfor> logininforList);

    @Mappings({
            @Mapping(target = "ascs",ignore = true),
            @Mapping(target = "asc",ignore = true),
            @Mapping(target = "descs",ignore = true),
            @Mapping(target = "desc",ignore = true),
    })
    Page<SysLogininforDTO> entity2dto(Page<SysLogininfor> logininforPage);

//    List<SysLogininforExcel> entity2Excel(List<SysLogininfor> logininforList);

    SysLogininfor dto2entity(SysLogininforDTO dto);

    @Mappings({
            @Mapping(target = "ascs",ignore = true),
            @Mapping(target = "asc",ignore = true),
            @Mapping(target = "descs",ignore = true),
            @Mapping(target = "desc",ignore = true),
    })
    Page<SysLogininfor> dto2entity(Page<SysLogininforDTO> logininforPage);

}
